<?php require_once('../../core/import.php');?>
<?php User::Permission('FUNCTION_PERMISSION_ADD'); ?>
<?php
    if($_SERVER['REQUEST_METHOD']=='POST')
    {
	  
        DB::Insert('management_user_permission',array
		(
			
			'Name'=>Functions::FormArgs('Name_Add'),
			'Role'=>Functions::FormArgs('Role_Add'),
			'URL'=>Functions::FormArgs('URL_Add'),
			'Identifying_Parent'=>Functions::FormArgs('ClassID'),
			'IsList'=>Functions::FormArgs('IsList_Add'),
			'Datetime'=>date('Y-m-d G:i:s')
		));
	  $data_identifying=DB::GetRows('select ID from `management_user_permission` order by Datetime desc'); 
	  $data_identifying=$data_identifying[0][0];
	  $Data=array(
	  		'Identifying'=>$data_identifying
	  );
	  DB::UpdateRowByID('management_user_permission',$data_identifying,$Data);
	  Functions::JsLocation('function.permission.list.php');
    }
?>